import { axios } from '@/utils/request'
// 订阅管理接口模块

// 获取订阅服务详情
function getServiceVehicleDetail (params) {
  return axios({
    url: '/service-sale/serviceVehicle/detail',
    method: 'get',
    params
  })
}

// 导出订阅列表
function exportServiceVehicle (params) {
  return axios({
    url: '/service-sale/serviceVehicle/export',
    method: 'get',
    params,
    responseType: 'blob'
  })
}

// 查询订阅服务列表
function getServiceVehicleList (params) {
  return axios({
    url: '/service-sale/serviceVehicle/list',
    method: 'get',
    params
  })
}

// 查询订阅服务列表
function getActiveList (params) {
  return axios({
    url: '/service-sale/active/list',
    method: 'post',
    params
  })
}

// 下载失败日志
function downloadServiceVehicleLog (params) {
  return axios({
    url: '/service-sale/serviceVehicle/export/fail/log',
    method: 'get',
    params,
    responseType: 'blob'
  })
}

// 根据vin查询订阅服务列表
function getServiceVehicleListByVin (params) {
  return axios({
    url: '/service-sale/serviceVehicle/list/vin',
    method: 'get',
    params
  })
}

export default {
  getServiceVehicleDetail,
  exportServiceVehicle,
  getServiceVehicleList,
  getActiveList,
  downloadServiceVehicleLog,
  getServiceVehicleListByVin
}
